package view;
import javax.swing.JMenuItem;

import java.util.Observable;
import java.util.Observer;

public class CustomMenuItem extends JMenuItem implements Observer{
	
	private static final long serialVersionUID = 1L;
	
	public CustomMenuItem(Observable obs, String txt){
		obs.addObserver(this);
		setText(txt);
	}
	
	public void update(Observable obs, Object obj){
		setEnabled((isEnabled()) ? false: true);
	}
}
